package com.it.testDemo;

import com.it.collection.Book;
import com.it.collection.Stu;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test1 {
  @Test
    public void  testDemo1(){
    ApplicationContext context=new ClassPathXmlApplicationContext("bean1.xml");
    Stu stu = context.getBean("stu", Stu.class);
    stu.test();
  }
  @Test
  public void  testDemo2(){
    ApplicationContext context=new ClassPathXmlApplicationContext("bean2.xml");
    Book book = context.getBean("book", Book.class);
    Book book1 = context.getBean("book", Book.class);
    Book book2 = context.getBean("book", Book.class);
    System.out.println(book1);
    System.out.println(book2);
    book.test();
  }
}
